package com.zkthink.ceres.order.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.zkthink.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 评价表
 * </p>
 *
 * @author JustArgo
 * @since 2020-07-12
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_comment")
@ApiModel(value = "Comment", description = "评价表")
@AllArgsConstructor
public class Comment extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 父评价id
     */
    @ApiModelProperty(value = "父评价id")
    @NotNull(message = "父评价id不能为空")
    @TableField("parent_id")
    @Excel(name = "父评价id")
    private Long parentId;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @NotNull(message = "用户id不能为空")
    @TableField("mid")
    @Excel(name = "用户id")
    private Long mid;

    /**
     * 订单商品id
     */
    @ApiModelProperty(value = "订单商品id")
    @NotNull(message = "订单商品id不能为空")
    @TableField("order_product_id")
    @Excel(name = "订单商品id")
    private Long orderProductId;

    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @NotNull(message = "商品id不能为空")
    @TableField("product_id")
    @Excel(name = "商品id")
    private Long productId;

    /**
     * 描述相符评分 1 - 5 星级数
     */
    @ApiModelProperty(value = "描述相符评分 1 - 5 星级数")
    @NotNull(message = "描述相符评分 1 - 5 星级数不能为空")
    @TableField("desc_star")
    @Excel(name = "描述相符评分 1 - 5 星级数")
    private Integer descStar;

    /**
     * 物流评分
     */
    @ApiModelProperty(value = "物流评分")
    @NotNull(message = "物流评分不能为空")
    @TableField("logistics_star")
    @Excel(name = "物流评分")
    private Integer logisticsStar;

    /**
     * 服务态度评分
     */
    @ApiModelProperty(value = "服务态度评分")
    @NotNull(message = "服务态度评分不能为空")
    @TableField("service_star")
    @Excel(name = "服务态度评分")
    private Integer serviceStar;

    /**
     * 主评分 
     */
    @ApiModelProperty(value = "主评分 ")
    @NotNull(message = "主评分 不能为空")
    @TableField("comment_star")
    @Excel(name = "主评分 ")
    private Integer commentStar;

    /**
     * 评论内容
     */
    @ApiModelProperty(value = "评论内容")
    @NotEmpty(message = "评论内容不能为空")
    @Length(max = 1024, message = "评论内容长度不能超过1024")
    @TableField(value = "comment_text", condition = LIKE)
    @Excel(name = "评论内容")
    private String commentText;

    /**
     * 评论类型 1-评价 2-追评
     */
    @ApiModelProperty(value = "评论类型 1-评价 2-追评")
    @NotNull(message = "评论类型 1-评价 2-追评不能为空")
    @TableField("biz_type")
    @Excel(name = "评论类型 1-评价 2-追评")
    private Integer bizType;

    /**
     * 评论图片
     */
    @ApiModelProperty(value = "评论图片")
    @NotEmpty(message = "评论图片不能为空")
    @Length(max = 4096, message = "评论图片长度不能超过4096")
    @TableField(value = "comment_imgs", condition = LIKE)
    @Excel(name = "评论图片")
    private String commentImgs;

    /**
     * 是否拥有图片
     */
    @ApiModelProperty(value = "是否拥有图片")
    @NotNull(message = "是否拥有图片不能为空")
    @TableField("comment_imgs_flag")
    @Excel(name = "是否拥有图片", replace = {"是_true", "否_false", "_null"})
    private Boolean commentImgsFlag;

    /**
     * 点赞数
     */
    @ApiModelProperty(value = "点赞数")
    @NotNull(message = "点赞数不能为空")
    @TableField("like_num")
    @Excel(name = "点赞数")
    private Integer likeNum;

    /**
     * 店铺id
     */
    @ApiModelProperty(value = "店铺id")
    @NotNull(message = "店铺id不能为空")
    @TableField("store_id")
    @Excel(name = "店铺id")
    private Long storeId;

    /**
     * 是否隐藏 1-隐藏 0-不隐藏
     */
    @ApiModelProperty(value = "是否隐藏 1-隐藏 0-不隐藏")
    @NotNull(message = "是否隐藏 1-隐藏 0-不隐藏不能为空")
    @TableField("hide_flag")
    @Excel(name = "是否隐藏 1-隐藏 0-不隐藏", replace = {"是_true", "否_false", "_null"})
    private Boolean hideFlag;

    /**
     * 是否包含敏感词 1-包含 0-不包含
     */
    @ApiModelProperty(value = "是否包含敏感词 1-包含 0-不包含")
    @NotNull(message = "是否包含敏感词 1-包含 0-不包含不能为空")
    @TableField("sensitive_flag")
    @Excel(name = "是否包含敏感词 1-包含 0-不包含", replace = {"是_true", "否_false", "_null"})
    private Boolean sensitiveFlag;

    /**
     * 是否删除 1-删除 0-不删除
     */
    @ApiModelProperty(value = "是否删除 1-删除 0-不删除")
    @NotNull(message = "是否删除 1-删除 0-不删除不能为空")
    @TableField("is_delete")
    @Excel(name = "是否删除 1-删除 0-不删除", replace = {"是_true", "否_false", "_null"})
    private Boolean isDelete;
    @ApiModelProperty(value = "订单id")
    @TableField("chlorder_id")
    private Long chlorderId;


    @Builder
    public Comment(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, 
                    Long parentId, Long mid, Long orderProductId, Long productId, Integer descStar, Integer logisticsStar,
                    Integer serviceStar, Integer commentStar, String commentText, Integer bizType, String commentImgs, Boolean commentImgsFlag, 
                    Integer likeNum, Long storeId, Boolean hideFlag, Boolean sensitiveFlag, Boolean isDelete) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.parentId = parentId;
        this.mid = mid;
        this.orderProductId = orderProductId;
        this.productId = productId;
        this.descStar = descStar;
        this.logisticsStar = logisticsStar;
        this.serviceStar = serviceStar;
        this.commentStar = commentStar;
        this.commentText = commentText;
        this.bizType = bizType;
        this.commentImgs = commentImgs;
        this.commentImgsFlag = commentImgsFlag;
        this.likeNum = likeNum;
        this.storeId = storeId;
        this.hideFlag = hideFlag;
        this.sensitiveFlag = sensitiveFlag;
        this.isDelete = isDelete;
    }

}
